<%@page import="com.beinfo.contract.model.Contract"%>
<%@page import="com.beinfo.contract.dao.ContractDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="dbconn.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>合同管理系统</title>
</head>
<body>
<%
			int con_id=Integer.valueOf(request.getParameter("con_id"));
		//	String username=new String(request.getParameter("username")); 
			int con_state=1;
			ContractDao dao=new ContractDao();
    		Contract t1=dao.getidbycnoid(con_id);
			
			try{
				if(conn != null){
					//if(username.equals(request.getParameter("admin"))){
						
					String sql="UPDATE t_contract SET con_state=1,con_approver='admin' WHERE con_id="+t1.getCon_id()+"";
					st.executeUpdate(sql);  
			         request.getRequestDispatcher("/conlist.jsp").forward(request, response);
				//	}
				}
					else{
					out.println("数据库连接失败！");
				}
			}catch (SQLException e) {  
				e.printStackTrace();  
				request.getRequestDispatcher("/conlist.jsp").forward(request, response);
		}finally{
			 conn.close();  
		}

%>>
</body>
</html>